package org.butterfly.irms.controller;

import org.butterfly.irms.model.vo.RegionVO;
import org.butterfly.irms.service.RegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/region", produces = MediaType.APPLICATION_JSON_VALUE)
public class RegionController {
    @Autowired
    private RegionService regionService;

    @GetMapping("/query")
    public ResponseEntity<List<RegionVO>> queryRegion() {
        List<RegionVO> res = regionService.queryRegion();
        return new ResponseEntity<>(res, HttpStatus.OK);
    }
}
